﻿using AutoMapper;
using BCDto.Trading.SaleContract;
using BCDto.Trading.SaleContractChecklist;
using BCDto.Trading.SaleContractReceiptRecord;
using BCEntity.Trading.SaleContract;
using BCEntity.Trading.SaleContractChecklist;
using BCEntity.Trading.SaleContractReceiptRecord;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.MapperProfiles.Trading.SaleContract
{
    public class SaleContractProfile : Profile
    {
        public SaleContractProfile()
        {
            //销售合同
            CreateMap<SaleContractDto, SaleContractEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractRequestDto, SaleContractPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractRequestDto, SaleContractEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractPutDto, SaleContractEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractEntity, SaleContractDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();

            //销售合同清单
            CreateMap<SaleContractChecklistDto, SaleContractChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractChecklistRequestDto, SaleContractChecklistPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractChecklistRequestDto, SaleContractChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractChecklistPutDto, SaleContractChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractChecklistEntity, SaleContractChecklistDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();

            //销售合同收款记录
            CreateMap<SaleContractReceiptRecordDto, SaleContractReceiptRecordEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractReceiptRecordRequestDto, SaleContractReceiptRecordPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractReceiptRecordRequestDto, SaleContractReceiptRecordEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractReceiptRecordPutDto, SaleContractReceiptRecordEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<SaleContractReceiptRecordEntity, SaleContractReceiptRecordDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
        }
    }
}
